#include    "hydro-pump.h"

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
HydroPump::HydroPump(QObject *parent) : Device(parent)
  , K_press(0.06)
  , T(1.0)
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
HydroPump::~HydroPump()
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void HydroPump::preStep(state_vector_t &Y, double t)
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void HydroPump::ode_system(const state_vector_t &Y,
                           state_vector_t &dYdt,
                           double t)
{
    dYdt[0] = (K_press * omega - Y[0]) / T;
}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void HydroPump::load_config(CfgReader &cfg)
{
    QString secName = "Device";

    cfg.getDouble(secName, "K_press", K_press);
    cfg.getDouble(secName, "T", T);
}
